package com.stox.client.ui.javafx.watchlist.widget;

import javafx.geometry.Pos;
import javafx.scene.control.ComboBox;
import javafx.util.StringConverter;

import com.stox.client.ui.javafx.watchlist.model.OWatchlist;

public class WatchlistComboBox extends ComboBox<OWatchlist> {

	public WatchlistComboBox() {
		setVisibleRowCount(5); // TODO should come from settings
		getEditor().setAlignment(Pos.CENTER);
		setItems(OWatchlist.ALL);
		OWatchlist.fetchAll();
		setConverter(new StringConverter<OWatchlist>(){
			@Override
			public OWatchlist fromString(String string) {
				return null;
			}
			@Override
			public String toString(OWatchlist object) {
				return null == object ? "" : object.getName();
			}
		});
	}
}
